package homework.day10;

import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 * @author XingHaiYang
 * @date 2022/9/16 20:26
 */
public class Test03 {
	public static void main(String[] args) {
		Collection c = new HashSet();
		for (int i = 0; i < 10; i++) {
			int random = (int)(Math.random()*100);
			c.add(random);
		}
		Iterator iterator = c.iterator();
		while (iterator.hasNext()){
			System.out.println(iterator.next());
		}
	}
}
